package servlets;

import dao.impl.FeedBackDaoImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@WebServlet(name = "上报信息已读操作", value = "/readedServlet")
public class ReadedServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        FeedBackDaoImpl feedBackDao = new FeedBackDaoImpl();
        int num = Integer.parseInt(request.getParameter("num"));
        System.out.println(num);
        int i = feedBackDao.updateFlag(num);
        System.out.println(i);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }
}